package com.ruoyi.ylyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ylyx.mapper.YlyxUserMapper;
import com.ruoyi.ylyx.domain.YlyxUser;
import com.ruoyi.ylyx.service.IYlyxUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户信息Service业务层处理
 * 
 * @author yuexl
 * @date 2021-02-05
 */
@Service
public class YlyxUserServiceImpl implements IYlyxUserService 
{
    @Autowired
    private YlyxUserMapper ylyxUserMapper;

    /**
     * 查询用户信息
     * 
     * @param id 用户信息ID
     * @return 用户信息
     */
    @Override
    public YlyxUser selectYlyxUserById(String id)
    {
        return ylyxUserMapper.selectYlyxUserById(id);
    }

    /**
     * 查询用户信息列表
     * 
     * @param ylyxUser 用户信息
     * @return 用户信息
     */
    @Override
    public List<YlyxUser> selectYlyxUserList(YlyxUser ylyxUser)
    {
        return ylyxUserMapper.selectYlyxUserList(ylyxUser);
    }

    /**
     * 新增用户信息
     * 
     * @param ylyxUser 用户信息
     * @return 结果
     */
    @Override
    public int insertYlyxUser(YlyxUser ylyxUser)
    {
        ylyxUser.setCreateTime(DateUtils.getNowDate());
        return ylyxUserMapper.insertYlyxUser(ylyxUser);
    }

    /**
     * 修改用户信息
     * 
     * @param ylyxUser 用户信息
     * @return 结果
     */
    @Override
    public int updateYlyxUser(YlyxUser ylyxUser)
    {
        ylyxUser.setUpdateTime(DateUtils.getNowDate());
        return ylyxUserMapper.updateYlyxUser(ylyxUser);
    }

    /**
     * 删除用户信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYlyxUserByIds(String ids)
    {
        return ylyxUserMapper.deleteYlyxUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户信息信息
     * 
     * @param id 用户信息ID
     * @return 结果
     */
    @Override
    public int deleteYlyxUserById(String id)
    {
        return ylyxUserMapper.deleteYlyxUserById(id);
    }
}
